#pragma once

#define _USE_MATH_DEFINES
#include "math.h"
#include <cstdlib>
#include "SFML/System.hpp"

namespace Util
{
	void SeedRandom();

	float Random(float min, float max);
	float Random(int min, int max);

	sf::Vector2f VecRand(float min, float max);
	
	float Angle(sf::Vector2<float> Pos1, sf::Vector2<float> Pos2);

	float RadToDeg(float Rad);
	float DegToRad(float Deg);

	float NormalizeAngle(float Deg);

	float Approach(float Current, float Target, float Inc);
	float RotateTowards(float ang , float targ, float speed);

	float Distance(sf::Vector2f One, sf::Vector2f Two);
	float Length(sf::Vector2f Vec);
	float LengthSquared(sf::Vector2f Vec);

	sf::Vector2f Normalize(sf::Vector2f Vec);

	float VecDot(sf::Vector2f One, sf::Vector2f Two);
	float VecCross(sf::Vector2f One, sf::Vector2f Two);
	sf::Vector2f VecNormal(sf::Vector2f Vec);
	sf::Vector2f VecProject(sf::Vector2f Point, sf::Vector2f Axis);

	sf::Vector2f VecScale(sf::Vector2f Vec, float scale);

	float PointToLineDist(sf::Vector2f One, sf::Vector2f Two, sf::Vector2f Point);
}